package model.commands.flow;

import java.util.List;

import model.RandomUtils;
import model.commands.AbstractCompositeCommand;
import model.commands.Command;

public class RandomSelect extends AbstractCompositeCommand {

	@Override
	public void execute() {
		resetRunningVariables();
		List<Command> commands = getCommands();
		int size = commands.size();
		if(size > 0){
			int index = RandomUtils.getRandomNumber(0, size);
			commands.get(index).execute();
		}
		propertyChangeSupport.firePropertyChange(EXECUTION_FINISHED, null, this);
	}
	
	@Override
	public void setParams(Object[] params) {
		// Do Nothing
	}

}
